#include <bits/stdc++.h>
using namespace std;
int n,q;
struct numbe{
	int num,val;
}a[8080];
bool cmp(numbe s1,numbe s2){
	if(s1.val==s2.val){
		return s1.num<s2.num;
	}
	else{
		return s1.val<s2.val;
	}
}
int main(){
	freopen("sort.in","r",stdin);
	freopen("sort.out","w",stdout);
	cin >> n >> q;
	for (int i=1;i<=n;i++){
		cin >> a[i].val;
		a[i].num=i;
	}
	for (int i=1;i<=q;i++){
		int flag;
		cin >> flag;
		if(flag==1){
			int x,v;
			cin >> x >> v;
			a[x].val=v;
		}
		else{
			int x;
			cin >> x;
			int fin=a[x].val,id=a[x].num;
			numbe flag[8080];
			for (int i=1;i<=n;i++){
				flag[i].val=a[i].val;
				flag[i].num=a[i].num;
			}
			sort(flag+1,flag+n+1,cmp);
			for (int i=1;i<=n;i++){
				if(flag[i].val==fin&&id==flag[i].num){
					cout << i << endl;
				}
			}
		}
	}
}
